
//导入NestFactory，用来创建Nest的应用实例
import { NestFactory } from '@nestjs/core';

import * as cookieParser from 'cookie-parser'
import * as session from 'express-session'




//主模块，用于组织Nest应用的入口
import { AppModule } from './app.module';

const port = 9898;

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  app.enableCors(); //启用跨域功能

  //会话
  app.use(cookieParser("tom"))
  app.use(session({
      secret:"cat"
  }))

  

  await app.listen(port,function(){
    console.log(`${port}端口服务已经启动，请输入http://localhost:${port}进行访问`)
  });
}

bootstrap();
